import request from '@/utils/request'
const baseUrl = process.env.VUE_APP_TMS_CONSOLE_HOST

// 获取运单列表
export function getWaybillList(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/search`,
    method: 'post',
    data
  })
}
// 提货
export function waybillLoading(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/loading`,
    method: 'post',
    data
  })
}
// 卸货
export function waybillUnLoading(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/unLoading`,
    method: 'post',
    data
  })
}
// 完成
export function waybillComplete(freightNo) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/${freightNo}/complete`,
    method: 'post'
  })
}
// 获取运单详情
export function getWaybillDetail(freightNo) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/${freightNo}/detail`,
    method: 'get'
  })
}

// 批量签收
export function postBatchComplete(data) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/batchComplete`,
    method: 'post',
    data
    // data
  })
}
// 取消订单
export function closeWaybill(freightNo) {
  return request({
    url: `${baseUrl}/api/v1/tms-freight/${freightNo}/complete`,
    method: 'post'
  })
}
